<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="webkit" name="renderer" />
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>

    <link rel="stylesheet" th:href="@{/src/css/layui.css}">
    <link th:href="@{/src/css/login.css}" rel="stylesheet"/>
</head>
<body>
    <div class="logon">
        <div class="logon-frame logon-nopadding">
            <div class="logon-sort">
				<a href="javascript:;">账号登录</a>
                <a href="javascript:;" class="active">微信扫码登录/注册</a>
            </div>
            <div class="form-group logon-box-inner" style="display:block;">
                <form class="logon-form layui-form">
                    <div class="input-group">
                        <span class="input-group-addon"><em class="uesr-icon"></em></span>
                        <input type="text" class="form-control layui-input" name="account" placeholder="登录账号" value="" aria-describedby="inputGroupSuccess4Status">
                    </div>
                    <em for="email" class="invalid" style="display:none;">账号必须填写</em>
                    <div class="input-group">
                        <span class="input-group-addon"><em class="password-ico"></em></span>
                        <input type="password" name="password" class="form-control layui-input" placeholder="登录密码" aria-describedby="inputGroupSuccess4Status">
                    </div>
                    <div class="account-bar">
                        <div>
                            <input class="control-checkbox" data-checkbox id="rememberMe"
                                   type="checkbox" name="rememberMe">
                            <label class="control-checkbox-label" for="rememberMe">记住我的账号</label>
                            <a href="javascript:;" class="forgotpassword">忘记密码?</a>
                        </div>
                    </div>
                    <div class="logon-button">
                        <button type="button" class="btn btn-success btn-primary"
                                id="loginSubmit"  lay-submit lay-filter="loginSubmit">
                            登录
                        </button>
                    </div>
                    <div class="free-registration"><span>还没有账号？<a href="javascript:;" id="ReturnRegist">免费注册</a></span></div>
                </form>
            </div>
        </div>
        <div class="logon-copyright">
            <div class="logon-copyrightTip">为了获得更好的使用体验，建议使用<a href="javascript:;" target="_blank">谷歌浏览器(chrome)</a>
        </div>
    </div>
    </div>
    <script th:src="@{/src/js/jquery-1.9.1.min.js}"></script>
    <script th:src="@{/src/layui.js}"></script>
    <script>
            layui.use(['form','jquery','layer'],function () {
                var form = layui.form,
                    $ = layui.jquery,
                    layer = layui.layer;

                //data表单容器
                form.on('submit(loginSubmit)',function (data) {
                    $.ajax({
                        url:'/account/subLogin',
                        type:'post',
                        dataType:'json',
                        data:data.field,
                        success:function (result) {
                            if(result.code == 200){
                                location.href = "/index";
                            }else{
                                layer.msg('登录失败',{icon:5});
                            }
                        }
                    });
                })

            })
       
    </script>
</body>
</html>
